package com.hisense.hiioc.hismartplate.service;

import com.hisense.hiioc.hismartplate.entity.dto.MesRobot;
import com.hisense.hiioc.hismartplate.robot.engine.HandlerChainBuilder;
import com.hisense.hiioc.hismartplate.robot.engine.IInputHander;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Auther:biexiande@hisense.com
 * @date:2018/12/17 9:40
 * @des 机器人对话
 */
@Service
public class RobotService  implements InitializingBean{
    private static final Logger LOGGER = LoggerFactory.getLogger(RobotService.class);

    IInputHander inputHander;

    public List<String> dialog(MesRobot mesRobot){
        List<String> directives = new ArrayList();
        inputHander.doProcess(mesRobot,directives);
        return directives;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        inputHander= HandlerChainBuilder.buildChains();
        LOGGER.debug("语义处理链构建已完成");
    }
}